package com.winphone.uvam.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.winphone.uvam.entity.SysUser;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
  *  Mapper 接口
 * </p>
 *
 * @author lwl
 * @since 2017-12-13
 */
@Service
public interface SysUserMapper extends BaseMapper<SysUser> {

    /**
     *  查询所有
     * @param page
     * @param map
     * @return
     */
    List<SysUser> selectPageParam(Pagination page, Map map);

    /**
     * 根据用户id查询用户信息
     * @param id
     * @return
     */
    SysUser getSysUserInfoById(@Param("id") Long id);


    /**
     * 根据用户姓名查询用户信息
     * @param userName
     * @return
     */
    SysUser getSysUserInfoByUserName(String userName);

    /**
     *  修改用户
     * @param sysUser
     * @return
     */
    Integer updateSysUserInfo(SysUser sysUser);

    /**
     * 用户软删除
     * @param id
     * @return
     */
    Integer deleteById(Long id);


    /**
     * 唯一性验证
     */
    List<SysUser> selectByMapOnce(Map<String, Object> map);

}